package net.crashtoot.picasa.core.model;

import com.google.gdata.data.photos.UserFeed;

/**
 * Utilisateur picasa.
 * 
 * @author jboz
 */
public class User {

    private String id;
    private String title;
    private String icon;
    private String username;
    private String nickname;
    private String thumbnail;

    private long quotaLimit;
    private long quotaCurrent;

    private int nbAlbum = 0;

    public User() {
    }

    public User(UserFeed userFeed) {
        id = userFeed.getId();
        if (userFeed.getTitle() != null) {
            title = userFeed.getTitle().getPlainText();
        }
        icon = userFeed.getIcon();
        username = userFeed.getUsername();
        nickname = userFeed.getNickname();
        thumbnail = userFeed.getThumbnail();
        quotaLimit = userFeed.getQuotaLimit();
        quotaCurrent = userFeed.getQuotaUsed();

        if (userFeed.getAlbumEntries() != null) {
            nbAlbum = userFeed.getAlbumEntries().size();
        }
    }

    public String getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public String getIcon() {
        return icon;
    }

    public String getUsername() {
        return username;
    }

    public String getNickname() {
        return nickname;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public long getQuotaLimit() {
        return quotaLimit;
    }

    public long getQuotaCurrent() {
        return quotaCurrent;
    }

    public int getNbAlbum() {
        return nbAlbum;
    }
}
